VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form MMIFrmSet 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Form1"
   ClientHeight    =   2550
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3645
   ClipControls    =   0   'False
   Icon            =   "f2 MMIFrmSet.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2550
   ScaleWidth      =   3645
   StartUpPosition =   3  'Windows Default
   Begin MSComDlg.CommonDialog SelColor 
      Left            =   2040
      Top             =   120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CheckBox opt 
      Caption         =   "Snap to grid."
      Height          =   255
      Index           =   3
      Left            =   120
      TabIndex        =   2
      Top             =   1200
      Width           =   1695
   End
   Begin VB.TextBox newSettings 
      Height          =   285
      Index           =   1
      Left            =   120
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   840
      Width           =   495
   End
   Begin VB.TextBox newSettings 
      Height          =   285
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   480
      Width           =   495
   End
   Begin VB.CheckBox opt 
      Caption         =   "Start links on load."
      Height          =   255
      Index           =   2
      Left            =   120
      TabIndex        =   5
      Top             =   1800
      Width           =   2175
   End
   Begin VB.CheckBox opt 
      Caption         =   "Auto save screen on exit."
      Height          =   255
      Index           =   1
      Left            =   120
      TabIndex        =   4
      Top             =   2160
      Width           =   2175
   End
   Begin VB.CheckBox opt 
      Caption         =   "Auto load last screen."
      Height          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   3
      Top             =   1560
      Width           =   2295
   End
   Begin VB.CommandButton pB 
      Caption         =   "Accept"
      Default         =   -1  'True
      Height          =   375
      Index           =   1
      Left            =   2880
      TabIndex        =   6
      Top             =   120
      Width           =   735
   End
   Begin VB.CommandButton pB 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Index           =   0
      Left            =   2880
      TabIndex        =   7
      Top             =   600
      Width           =   735
   End
   Begin VB.Label Lbl 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Back Color"
      ForeColor       =   &H80000008&
      Height          =   255
      Index           =   2
      Left            =   120
      TabIndex        =   10
      Top             =   120
      Width           =   1800
   End
   Begin VB.Label Lbl 
      AutoSize        =   -1  'True
      Caption         =   "Y grid (pixels)"
      Height          =   195
      Index           =   1
      Left            =   720
      TabIndex        =   9
      Top             =   840
      Width           =   930
   End
   Begin VB.Label Lbl 
      AutoSize        =   -1  'True
      Caption         =   "X grid (pixels)"
      Height          =   195
      Index           =   0
      Left            =   720
      TabIndex        =   8
      Top             =   480
      Width           =   930
   End
End
Attribute VB_Name = "MMIFrmSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_DblClick()
'Select background color
        pB(1).Enabled = True
        SelColor.Color = MMI.BackColor
        SelColor.ShowColor
        newSettings(2).BackColor = SelColor.Color
End Sub

Private Sub Form_Load()
    Me.Caption = App.EXEName & " - Layout Settings."
    
    Me.Caption = LAY.Title
    Left = LAY.SETLeft
    Top = LAY.SETTop
    pB(1).Enabled = False
    
    Opt(0) = LAY.AutoLoad
    Opt(1) = LAY.AutoSave
    Opt(2) = LAY.AutoStart

    newSettings(0) = LAY.SnapX
    newSettings(1) = LAY.SnapY
    Opt(3) = LAY.Snap
    
    pB(1).Enabled = False
    
    Lbl(2).BackColor = MMI.BackColor
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    LAY.SETLeft = Me.Left
    LAY.SETTop = Me.Top
End Sub

Private Sub Lbl_Click(Index As Integer)
'Select background color
        pB(1).Enabled = True
        SelColor.Color = Lbl(2).BackColor
        SelColor.ShowColor
        Lbl(2).BackColor = SelColor.Color
End Sub

'Text entry - changed
Private Sub newSettings_Change(Index As Integer)
    pB(1).Enabled = True
End Sub

'Text entry - got focus
Private Sub newSettings_GotFocus(Index As Integer)
    newSettings(Index).SelStart = 0
    newSettings(Index).SelLength = Len(newSettings(Index))
End Sub

Private Sub opt_Click(Index As Integer)
    pB(1).Enabled = True
End Sub

Private Sub pB_Click(Index As Integer)
    Select Case Index
        Case 0
            Unload Me
        Case 1
        upDateSettings
        Unload Me
    End Select
End Sub

Private Sub upDateSettings()
    
    MMI.BackColor = Lbl(2).BackColor
    LAY.AutoLoad = Opt(0)
    LAY.AutoSave = Opt(1)
    LAY.AutoStart = Opt(2)

    LAY.SnapX = newSettings(0)
    LAY.SnapY = newSettings(1)
    LAY.Snap = Opt(3)
    
End Sub
